<html>

	<head>
            <link rel="stylesheet" type="text/css" href="scripts/prueba.css"/>
	</head>

	<body>

		<div class="pcpal">
                <div class="menu">
                <?php
                    require_once("scripts/Menu.php");
                ?>
                </div>
                <div class="content1">
                    <img src="/AppResiduos2/images/3095368.jpg" alt="energia" style="width: 800px; height: 330px;" align="middle">
                </div>
                <div class="content2">
		<form action="/AppResiduos2/control/ConstituyenteControl.php" method="post">
                    <input type="hidden" name="id_residue" value="<?php echo $_POST['id_residue']; ?>">
                    <input type="hidden" name="id_producer" value="<?php echo $_POST['id_producer']; ?>">
        <?php
                if (isset($_POST['newComponent'])){

	?>
                    
                    <input type="hidden" name="operation" value="newComponent">
                    <table id="others">
                        <tr class="alt2">
                            <td>
                                Component's id:
                            </td>
                            <td>
                                <input type="text" name="component_id" value="<?php echo $_POST['id_residue']; ?>">
                            </td>
                        </tr>
                        <tr class="alt2">
                            <td>
                                Component's name:
                            </td>
                            <td>
                                <input type="text" name="component_name">
                            </td>
                        </tr>
                        <tr class="alt2">
                            <td>
                                Component's quantity:
                            </td>
                            <td>
                                <input type="text" name="component_quantity">
                            </td>
                        </tr>    
                     
	<?php
		}
		if (isset($_POST['modifyComponent'])){
                    $id_component = $_POST['id_component'];
                    $name_component = $_POST['name_component'];
                    $quantity_component = $_POST['quantity_component'];
	?>
                    <input type="hidden" name="operation" value="modifyComponent">
                    <input type="hidden" name="id_component" value="<?php echo $id_component; ?>">
                    <table id="others">
                        <tr class="alt2">
                            <td>
                                Component's name:
                            </td>
                            <td>
                                <input type="text" disabled="true" name="component_name" value="<?php echo $name_component; ?>">
                            </td>
                        </tr>
                        <tr class="alt2">
                            <td>
                                Component's quantity:
                            </td>
                            <td>
                                <input type="text" disabled="true" name="component_quantity" value="<?php echo $quantity_component; ?>">
                            </td>
                        </tr>
                        <tr class="alt2">
                            <td>
                                Component's new quantity:
                            </td>
                            <td>
                                <input type="text" name="new_component_quantity"> 
                            </td>
                        </tr>
                     
                     
                     

	<?php
		}
		if (isset($_POST['deleteComponent'])){
                    $id_component = $_POST['id_component'];
                    $name_component = $_POST['name_component'];
	?>
                    <input type="hidden" name="operation" value="deleteComponent">
                    <input type="hidden" name="id_component" value="<?php echo $id_component; ?>">
                    <table id="others">
                        <tr class="alt2">
                            <td>
                                Component's name:
                            </td>
                            <td>
                                <input type="text" disabled="true" name="component_name" value="<?php echo $name_component ?>"> 
                            </td>
                        </tr>
                     
	<?php
		}
	?>
                        <tr class="alt2">
                            <td>
                            </td>
                            <td>
                                <input type="submit" value="Accept">
                            </td>
                        </tr>
                    </table>
		</form>
		</div>
                </div>
	</body>

</html>
